<?php
namespace Action;
use HY\Action;
!defined('HY_PATH') && exit('HY_PATH not defined.');
class Log extends HYBBS {
	public function __construct(){
		parent::__construct();
		//{hook a_index_init}
		if(!IS_LOGIN){
			if(IS_AJAX && IS_POST){
				die($this->json(array('error'=>false,'info'=>'请登录后再操作')));
			}
			else{
				header("location: ". HYBBS_URLA('user','login'));
				die;
			}

		}
	}
	public function showLog(){
		$this->view = 'CQQ';
		$this->v("title","流量控制");
        $this->v("title2","流量控制系统");
		$this->display('log');
	}
	public function getEventLog(){
	    $res = S('op_log')->query("select * from hy_op_log ORDER by lid DESC limit 1000")->fetchALL();
		$this->json([
		        "state"=>true,
				"data"=> $res,
                "count"=>count($res)
		]);
	}
    

	
	
	//{hook a_index_fun}
}
